1 <?php
2 include(
"header.php");
3 include(
"sidebar.php");
4 include(
"dbconnection.php");
5 ?>
6
7 <?php

8 if
(isset($_GET[serviceid]))
9 {
10 $result1= mysql_query(
"select * from service where serviecid='$_GET[serviceid]'");
11 $recrow1 = mysql_fetch_array($result1);
12
13 $result= mysql_query(
"select * from billing where serviceid='$_GET[serviceid]'");
14 $recrow = mysql_fetch_array($result);
15
16 }

17 else

18 {
19 $result2= mysql_query(
"SELECT MAX(serviecid) FROM service where custid='$_SESSION[custid]' AND status='Completed'");
20 $recrow2 = mysql_fetch_array($result2);
21
22 $result1= mysql_query(
"select * from service where serviecid='$recrow2[0]' AND status='Completed'");
23 $recrow1 = mysql_fetch_array($result1);
24
25 $result= mysql_query(
"select * from billing where serviceid='$recrow2[0]'");
26 $recrow = mysql_fetch_array($result);
27 }
28
29 ?>
30 <div id=
"main">
31             <a name=
"TemplateInfo"></a>
32             <h1>Vehicle Service Billing</h1>
33 <form id=
"form1" name="form1" method="post" action="" onchange="Disable()">
34     <?php
35     
if( mysql_num_rows($result1) == 1)
36     {
37         ?>
38           <table width=
"504" border="1">
39             <tr>
40               <th width=
"210" scope="col">Service ID</th>
41               <th width=
"373" scope="col">&nbsp;<?php echo $recrow1[serviecid]; ?></th>
42             </tr>
43             <tr>
44               <th scope=
"col">Customer info</th>
45               <th scope=
"col">&nbsp;
46 <?php
47     $result1= mysql_query(
"select * from customer where custid='$recrow1[custid]'");
48     $arrrec1= mysql_fetch_array($result1);
49           echo $arrrec1[fname].
" ".$arrrec1[lname];
50               ?>
51               </th>
52             </tr>
53             <tr>
54               <th scope=
"col">Vehicle name</th>
55               <th scope=
"col">&nbsp;<?php echo $recrow1[vehiclename]; ?></th>
56             </tr>
57             <tr>
58               <th scope=
"col">Vehicle Number</th>
59               <th scope=
"col">&nbsp;<?php echo $recrow1[vehicleno]; ?></th>
60             </tr>
61             <tr>
62               <th scope=
"col">Date</th>
63               <th scope=
"col">&nbsp;<?php echo $recrow1[date]; ?></th>
64             </tr>
65             <tr>
66               <th scope=
"col">Pick up address</th>
67               <th scope=
"col">&nbsp;
68               <?php
69               echo $recrow1[address].
"<br>";
70               echo
"City : ".$recrow1[city]."<br>";
71               echo
"Land mark : ".$recrow1[landmark]."<br>";
72               echo
"ZIP Code : ".$recrow1[zipcode]."<br>";
73               
74
75
76               ?></th>
77             </tr>
78       </table>
79     <br />
80     <?php
81
82     
if($recrow[paidstatus] == "Paid")
83     {
84     ?>
85           <table width=
"504" border="1">
86 <tr>
87               <th width=
"210" scope="col">Billing No.</th>
88               <th width=
"373" scope="col">&nbsp;<?php echo $recrow[billingno]; ?></th>
89             </tr>
90             <tr>
91               <th scope=
"col">Service ID</th>
92               <th scope=
"col">&nbsp;<?php echo $recrow[serviceid]; ?></th>
93             </tr>
94             <tr>
95               <th scope=
"col">Particulars</th>
96               <th scope=
"col">&nbsp;<?php echo $recrow[particulars]; ?></th>
97             </tr>
98             <tr>
99               <th scope=
"col">Service Cost</th>
100               <th scope=
"col">&nbsp;<?php echo $recrow[scost]; ?></th>
101             </tr>
102             <tr>
103               <th scope=
"col">Date</th>
104               <th scope=
"col">&nbsp;<?php echo $recrow[date]; ?></th>
105             </tr>
106             <tr>
107               <th scope=
"col">Service Status</th>
108               <th scope=
"col">&nbsp;<?php
109              echo $recrow[paidstatus];
110                ?></th>
111             </tr>
112           </table>
113     <?php
114     }
115     
else if($recrow[paidstatus] == "Pending")
116     {
117         echo
"<center><h3>Payement status : Pending</h3></center>";
118     }
119     
else
120     {
121         echo
"<center><h3>Cancelled</h3></center>";
122     }
123      
124     }
125     
else
126     {
127         echo
"<h4>No records found</h4>";
128     }
129     ?>
130           <br />
131
132     </form>
133     
134 <br />
135                                             
136 </div>
137         
138 <!-- wrap ends here -->
139 </div>
140         
141 <?php
142 include(
"footer.php");
143 ?>


Gõ tìm kiếm nhanh...